<?php

namespace app\api\controller;

use app\common\business\User as userBn;
use app\common\business\Match as matchBn;
use app\common\business\Guess as guessBn;
use app\common\business\user\UserSign as userSignBn;
use think\Validate;

class My extends \app\common\controller\HomeBase {

    /**
     * 我的答题
     */
    public function myanswer() {
        try {
            $user_id = $this->_validLogin(); 
            $params = input();
            $params['user_id']=$user_id;
            $data = matchBn::myanswer($params);
            $this->_echoSuccessMessage('', $data);
        } catch (\Exception $e) {
            $this->_echoErrorMessage($e->getMessage(), $e->getCode());
        }
    }
    
     /**
     * 我的答题详情
     */
    public function myanswershow() {
        try {
            $user_id = $this->_validLogin();
            $params = input();
            $params['user_id']=$user_id;
            $data = matchBn::myanswershow($params);
            $this->_echoSuccessMessage('', $data);
        } catch (\Exception $e) {
            $this->_echoErrorMessage($e->getMessage(), $e->getCode());
        }
    }

    /**
     * 我的推演
     */
    public function myguess() {
        try {
            $user_id = $this->_validLogin();
            $params = input();
            $params['user_id'] = $user_id;
            $data = guessBn::myguess($params);
            $this->_echoSuccessMessage('', $data);
        } catch (\Exception $e) {
            $this->_echoErrorMessage($e->getMessage(), $e->getCode());
        }
    }
    
    
    /**
     * 签到
     * 
     */
    public function usersign() {
       try {
            $user_id = $this->_validLogin();
            $post['user_id'] = $user_id;
            $data = userSignBn::addSign($post);
            $this->_echoSuccessMessage('', $data);
        } catch (\Exception $e) {
           $this->_echoErrorMessage($e->getMessage(), $e->getCode());
        }
    }

    /**
     * 签到
     * 
     */
    public function continuesign() {
        try {
            $user_id = $this->_validLogin();
            $post['user_id'] = $user_id;
            $data = userSignBn::continuesignshow($user_id);
            $this->_echoSuccessMessage('', $data);
        } catch (\Exception $e) {
            $this->_echoErrorMessage($e->getMessage(), $e->getCode());
        }
    }

}
